package com.ruoyi.user.controller;

import com.ruoyi.common.core.domain.IdVo;
import com.ruoyi.common.core.domain.PermVo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.user.service.TbPermService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 咸鱼
 * @version 1.0
 * @description: TODO
 * @date 2023/1/13 11:22
 */
@RestController
@RequestMapping("/perm")
public class TbPermController {

    @Autowired
    private TbPermService tbPermService;

    @PostMapping("/addPerm")
    public R addPerm(@RequestBody PermVo permVo){
        return tbPermService.addPerm(permVo);
    }

    @DeleteMapping("/deletePermById")
    public R deletePerm(@RequestBody IdVo idVo){
        return tbPermService.deletePerm(idVo);
    }

    @GetMapping("/selectPerm")
    public AjaxResult selectPerm(){
        return tbPermService.selectPerm();
    }

    @PostMapping("/updatePerm")
    public R updatePerm(@RequestBody PermVo permVo){
        return tbPermService.updatePerm(permVo);
    }
}
